function findPicList(){
	//图片新闻
	$.ajax({  
		type: "POST",  
        url: '../WebIntranetPc/queryIntranetArticle.json', 
	    data:{		    	    	  
	    	  isHomePic:'1'
	    },  		    	     
	    cache:false,  
	    dataType:'json',  
	    success:function(data) { 
	    	if(data!=null && data.length>0){		    	    		
	    		$.each(data,function(idx,obj){
	    			var maxwidth=15; 
	    			if(obj.title.length>maxwidth){
	    				obj.title=obj.title.substring(0,maxwidth);
	    				obj.title+=' ...';  
	    			}	    			
	    			var url='../WebIntranetPc/IntranetArticle.htm?id='+encode64((obj.id).toString());	    			
	    			var addhtml = '<a target="_blank" href="'+url+'">' +
    						         '<img src="'+obj.imagesPath.split(',').shift()+'"  title="'+obj.title+'" />' +
    						      '</a>';
	                $("#picnews").append(addhtml);	    	                
	    		});
	    		
	    		$('#picnews').nivoSlider({	
	    			manualAdvance:true,
					 directionNav: false, //是否显示图片切换按钮(上/下页)
					 directionNavHide: true, //是否鼠标经过才显示
		        	 controlNav: true,               // 是否显示图片导航控制按钮（,2,3... ）  
		             pauseOnHover: true            // 鼠标县浮时是否停止动画 
		        });			    	    		
	    	}	
	    },  
	    error : function() { }  
	});
}

//查找文章
function queryArticleList(categoryId,ulId){
	var listNum=6;
	$.ajax({  
		type: "POST",  
        url: '../WebIntranetPc/queryIntranetArticle.json', 
	    data:{  
	    	  categoryID:categoryId,	
	    	  topNum:listNum
	    },  		    	     
	    cache:false,  
	    dataType:'json',  
	    success:function(data) { 
	    	if(data!=null && data.length>0){		    	    		
	    		$.each(data,function(idx,obj){
					var maxwidth=15; 
					if(obj.title.length>maxwidth){
	    				obj.title=obj.title.substring(0,maxwidth);
	    				obj.title+=' ...'; 
	    			}	       
	    			var url='../WebIntranetPc/IntranetArticle.htm?id='+encode64((obj.id).toString());
	    			
	    			var addhtml = '<li><a target="_blank" style="color:'+obj.titleColor+'" href="'+url+'">'+obj.title+'</a>'+
								      '<span class="date">'+new Date(obj.modifyDate).format("yyyy-MM-dd")+'</span>'+
							      '</li>';
	    			$("#"+ulId).append(addhtml);
	    		});
	    		
	    		//if(data.length==listNum){ //更多
	    			var moreUrl='../WebIntranetPc/articleListInterface.htm?id='+encode64((categoryId).toString());	    			
		    		var moreHtml='<a target="_blank" class="amore" href="'+moreUrl+'" >+MORE</a>';		    		
		    	    $("#"+ulId).nextAll(".more").html(moreHtml); 		    	    
	    		//}
	    	}	
	    },  
	     error : function() {  
	          
	     }  
	});
}


function openArticle(articleId){
	var url="../WebIntranetPc/IntranetArticle.htm?id="+encode64(articleId);	           
	window.location.href=url;
}

//格式化日期
Date.prototype.format = function(format) {
    var o = {
        "M+": this.getMonth() + 1, // month
        "d+": this.getDate(), // day
        "h+": this.getHours(), // hour
        "m+": this.getMinutes(), // minute
        "s+": this.getSeconds(), // second
        "q+": Math.floor((this.getMonth() + 3) / 3), // quarter
        "S": this.getMilliseconds()
        // millisecond
    }
    if (/(y+)/.test(format))
        format = format.replace(RegExp.$1, (this.getFullYear() + "")
            .substr(4 - RegExp.$1.length));
    for (var k in o)
        if (new RegExp("(" + k + ")").test(format))
            format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
    return format;
}

//base64加密开始
var keyStr = "ABCDEFGHIJKLMNOP" + "QRSTUVWXYZabcdef" + "ghijklmnopqrstuv" + "wxyz0123456789+/" + "=";

function encode64(input) {
        var output = "";
        var chr1, chr2, chr3 = "";
        var enc1, enc2, enc3, enc4 = "";
        var i = 0;
        do {
                chr1 = input.charCodeAt(i++);
                chr2 = input.charCodeAt(i++);
                chr3 = input.charCodeAt(i++);
                enc1 = chr1 >> 2;
                enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
                enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
                enc4 = chr3 & 63;
                if (isNaN(chr2)) {
                        enc3 = enc4 = 64;
                } else if (isNaN(chr3)) {
                        enc4 = 64;
                }
                output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2)
                                + keyStr.charAt(enc3) + keyStr.charAt(enc4);
                chr1 = chr2 = chr3 = "";
                enc1 = enc2 = enc3 = enc4 = "";
        } while (i < input.length);

        return output;
}
// base64加密结束

